package ter.find.pattern.gui;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

class TableColorLine extends DefaultTableCellRenderer {  

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TableColorLine() {  
		setOpaque(true);  
	}  

	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {  

		if(row%2==0){
			setBackground(Color.white);  
		}else{
			setBackground(new Color(230, 230, 235)); 
		}

		//setForeground(Color.black);  
		setText(value !=null ? value.toString() : "");  
		return this;  
	}  
}   
